colorscale: Remove x/y arguments from snapshot_scale
authorTimm Bäder <mail@baedert.org>
Fri, 9 Nov 2018 17:01:26 +0000 (18:01 +0100)
committerTimm Bäder <mail@baedert.org>
Fri, 9 Nov 2018 17:01:58 +0000 (18:01 +0100)
We only pass 0 anyway.

gtk/gtkcolorscale.c
gtk/gtkcolorscaleprivate.h
gtk/gtkrange.c

index 16034ae984714c50b65c78875cdc063c680ac72c..a606e048a98515121d1b369384c304dc47abd07b 100644 (file)
@@ -54,8 +54,6 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtkColorScale, gtk_color_scale, GTK_TYPE_SCALE)
 void
 gtk_color_scale_snapshot_trough (GtkColorScale  *scale,
                                  GtkSnapshot    *snapshot,
-                                 int             x,
-                                 int             y,
                                  int             width,
                                  int             height)
 {
@@ -102,7 +100,7 @@ gtk_color_scale_snapshot_trough (GtkColorScale  *scale,
 
       gtk_snapshot_append_texture (snapshot,
                                    texture,
-                                   &GRAPHENE_RECT_INIT(x, y, width, height));
+                                   &GRAPHENE_RECT_INIT(0, 0, width, height));
       g_object_unref (texture);
     }
   else if (priv->type == GTK_COLOR_SCALE_ALPHA)
@@ -111,21 +109,20 @@ gtk_color_scale_snapshot_trough (GtkColorScale  *scale,
       graphene_point_t start, end;
 
       cr = gtk_snapshot_append_cairo (snapshot,
-                                      &GRAPHENE_RECT_INIT(x, y, width, height));
-      cairo_translate (cr, x, y);
+                                      &GRAPHENE_RECT_INIT(0, 0, width, height));
 
       if (gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL &&
           gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
         {
           cairo_translate (cr, width, 0);
           cairo_scale (cr, -1, 1);
-          graphene_point_init (&start, x + width, y);
-          graphene_point_init (&end, x, y);
+          graphene_point_init (&start, width, 0);
+          graphene_point_init (&end, 0, 0);
         }
       else
         {
-          graphene_point_init (&start, x, y);
-          graphene_point_init (&end, x + width, y);
+          graphene_point_init (&start, 0, 0);
+          graphene_point_init (&end, width, 0);
         }
 
       cairo_pattern_t *pattern;
@@ -147,7 +144,7 @@ gtk_color_scale_snapshot_trough (GtkColorScale  *scale,
       color = &priv->color;
 
       gtk_snapshot_append_linear_gradient (snapshot,
-                                           &GRAPHENE_RECT_INIT(x, y, width, height),
+                                           &GRAPHENE_RECT_INIT(0, 0, width, height),
                                            &start,
                                            &end,
                                            (GskColorStop[2]) {
index f87a40221efd947cb4fd1285c50e8ef176e59ba7..d8ced03da61ba24d396835016106312b372aa53f 100644 (file)
@@ -63,8 +63,6 @@ void        gtk_color_scale_set_rgba (GtkColorScale     *scale,
 
 void        gtk_color_scale_snapshot_trough (GtkColorScale  *scale,
                                              GtkSnapshot    *snapshot,
-                                             int             x,
-                                             int             y,
                                              int             width,
                                              int             height);
 
index db97df7317599466988f82da4824f26150f62061..3a44685b6d4e12835d6526df08f72dea74a98be6 100644 (file)
@@ -1670,7 +1670,6 @@ gtk_range_render_trough (GtkGizmo    *gizmo,
    */
   if (GTK_IS_COLOR_SCALE (widget))
     gtk_color_scale_snapshot_trough (GTK_COLOR_SCALE (widget), snapshot,
-                                     0, 0,
                                      gtk_widget_get_width (GTK_WIDGET (gizmo)),
                                      gtk_widget_get_height (GTK_WIDGET (gizmo)));